package com.tlw.practice.tlw.dao;

import com.tlw.practice.tlw.entity.UserEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.lang.annotation.Native;
import java.util.List;
@Repository
public interface UserDao extends JpaRepository<UserEntity, String> {
    List<UserEntity> findAll();

    UserEntity findOneByUsername(String username);

//    @Query(value = "select y from  UserEntity y where y.username = ?1 and y.password = ?2")
    UserEntity findUserEntityByUsernameAndPassword(String username, String password);

    UserEntity findUserEntityById(String userId);
}
